<template>
  <div class="wrapper">
    <div class="search">
      <div 
      class="search__back iconfont"
      @click="handleBack"
      >&#xe602;</div>
      <div class="search__content">
        <span class="search__content__icon iconfont">&#xe600;</span>
        <input class="search__content__input" placeholder="请输入商品名称进行搜索">
      </div>
    </div>
    <ShopInfo :item="item" />
    <Content :shopId="$route.params.id"/>
    <Cart :shopId="$route.params.id"/>
  </div>
</template>

<script>
import {get} from '../../utils/utils'
import Content from './Content'
import Cart from './Cart'

import ShopInfo from "../../views/home/ShopInfo/ShopInfo";
export default {
  name: "Detail",
  components: { ShopInfo ,Content,Cart},
  data() {
    return {
      item: {
        
      },
    };
  },
  mounted() {
    get(`/api/shop/${this.$route.params.id}`).then(({ data }) => {
      this.item = data;
    });
  },
  methods: {
    handleBack(){
        this.$router.back();
    }
  },
};
</script>

<style lang="scss" scoped>
.wrapper {
  padding: 0 0.18rem;
}
.search {
  display: flex;
  height: 0.32rem;
  margin: 0.16rem 0;
  &__back {
    height: 0.32rem;
    width: 0.22rem;
    font-size: 0.25rem;
    line-height: 0.32rem;
    margin-right: 0.15rem;
    color: #9f9c9c;
  }
  &__content {
    flex: 1;
    background-color: #f5f5f5;
    border-radius: 0.16rem;
    &__icon {
      font-size: 0.20rem;
      line-height: .32rem;
      color: #9f9c9c;
      margin-left:.16rem;
      margin-right:.12rem;
    }
    &__input{
        color: #9f9c9c;
        border: none;
        outline: none;
        background:none;
        height: 0.32rem;
    }
  }
}
</style>